<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="销售意向" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="getPurchaseBill()"
                        ng-disabled="!btnPermission.sellIntentionAddAuto"
                        title="{{!btnPermission.sellIntentionAddAuto?'无权限执行此操作':''}}">自动制定销售意向
                    </button>
                    <button class="btn btn-operate m-r-sm" ng-click="makeIntention(1,{})"
                        ng-disabled="!btnPermission.sellIntentionAdd"
                        title="{{!btnPermission.sellIntentionAdd?'无权限执行此操作':''}}">手动制定销售意向</button>
                    <button class="btn btn-operate m-r-sm" ng-click="bathSynPrice()"
                        ng-disabled="!btnPermission.sellIntentionAdd"
                        title="{{!btnPermission.sellIntentionSynPrice?'无权限执行此操作':''}}">同步价格</button>

                    <button class="btn btn-operate m-r-sm" ng-click="getContractBill()">按合同创建</button>
                    <button ng-if="isDL||isZHL" class="btn btn-operate m-r-sm" ng-click="getMonitoringBill()">订单监控</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.sellIntentionExport">
                            <div title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl"
                                    download-param="exportParam.sectionParam" download-key="ids">
                                    <i class="yb-icon ico-export-o"></i> 导出
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition"
                                    download-duration="3" download-duration="3" is-ajax="true">
                                    <i class="yb-icon ico-export-o"></i> 导出全部
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="意向单号"
                            ng-model="condition.saleNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                    <div class="input-group-short pull-right clearfix" style="margin-right: 10px;"
                        ng-if="btnPermission.sellIntentionTJ">
                        <input type="text" class="form-control txt-search" placeholder="CRM单号"
                            ng-model="condition.crmOrder">
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()" date-picker="true" hide-date="switchDatePicker()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">意向单号：</label>
                        <textarea ng-model="condition.billNos" class="form-control" placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购单号：</label>
                        <input type="text" ng-model="condition.purchaseNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购合同号：</label>
                        <input type="text" ng-model="condition.purchaseContractNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">创建人：</label>
                        <input type="text" ng-model="condition.createName" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" ng-model="condition.purchaseOrgName" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <textarea ng-model="condition.purchaseNames" class="form-control"
                            placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购员：</label>
                        <input type="text" ng-model="condition.buyerName" class="form-control">
                    </div>
                    <div class="form-group clearfix" ng-if="!!isJCHK">
                        <label class="control-label">供货商：</label>
                        <input type="text" ng-model="condition.targetOrgName" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">单据状态：</label>
                        <select class="form-control" ng-model="condition.status">
                            <option value="">请选择</option>
                            <option value="0">已保存</option>
                            <option value="1">已提交</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">审核状态：</label>
                        <select class="form-control" ng-model="condition.checkFlag">
                            <option value="">请选择</option>
                            <option value="0">审核拒绝</option>
                            <option value="1">审核通过</option>
                            <option value="10">待审核</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none" ng-if="!!isJCHK">
                        <label class="control-label">首次提交日期：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.firstSubmitStartDate"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(2)"
                            is-open="datePickerFlag[2]" close-text="关闭"
                            ng-change="checkDate(condition, 'firstSubmitStartDate', 'firstSubmitEndDate')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix m-b-none" ng-if="!!isJCHK">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix" ng-if="!!isJCHK">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.firstSubmitEndDate"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(3)"
                            is-open="datePickerFlag[3]" close-text="关闭"
                            ng-change="checkDate(condition, 'firstSubmitStartDate', 'firstSubmitEndDate')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix" ng-if="!!isJCHK">
                        <label class="control-label">是否建采购订单：</label>
                        <select class="form-control" ng-model="condition.isCreatePurchaseOrder">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">零件编号：</label>
                        <textarea ng-model="condition.materialsNo" class="form-control" placeholder="逗号分隔或者换行分隔">
                        </textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">CRM单号：</label>
                        <input type="text" ng-model="condition.crmOrder" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">前移单号：</label>
                        <input type="text" ng-model="condition.pmsCode" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">出库状态：</label>
                        <select class="form-control" ng-model="condition.inventoryOutStatus"
                            ng-options="item.id as item.name for item in deliverStatusList" required yb-focus>
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购级别：</label>
                        <select class="form-control" ng-model="condition.purchaseLevelId"
                            ng-options="item.code as item.name for item in purchaseLevelList" required yb-focus>
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label">制单时间：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateStart"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(0)"
                            is-open="datePickerFlag[0]" close-text="关闭"
                            ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateEnd"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(1)"
                            is-open="datePickerFlag[1]" close-text="关闭"
                            ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">无价格：</label>
                        <select class="form-control" ng-model="condition.isSynPrice">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                    <div class="form-group clearfix" ng-if="isCHY">
                        <label class="control-label">物流状态:</label>
                        <select class="form-control" ng-model="condition.deliveryStatus">
                            <option value="">请选择</option>
                            <option value="0">未发货</option>
                            <option value="1">已发货</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">国家：</label>
                        <input type="text" ng-model="condition.country" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">境内/境外:</label>
                        <select class="form-control" ng-model="condition.inCountryFlag">
                            <option value="">请选择</option>
                            <option value="0">境内</option>
                            <option value="1">境外</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"><span translate>预计发货日期</span>：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.estimatedShippingStartDate"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showEstiShipDateEnd=false;showEstiShipStart=!showEstiShipStart"
                            is-open="showEstiShipStart" close-text="关闭"
                            ng-change="checkDate(condition, 'estimatedShippingStartDate', 'estimatedShippingEndDate')" modal-size="small"
                            readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.estimatedShippingEndDate"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showEstiShipStart=false;showEstiShipDateEnd=!showEstiShipDateEnd"
                            is-open="showEstiShipDateEnd" close-text="关闭"
                            ng-change="checkDate(condition, 'estimatedShippingStartDate', 'estimatedShippingEndDate')" modal-size="small"
                            readonly>
                    </div>

                    <div class="form-group clearfix" ng-if="isJCH">
                        <label class="control-label">合同号：</label>
                        <input type="text" ng-model="condition.contractNo" class="form-control">
                    </div>
                    <div class="form-group clearfix" ng-if="isJCH">
                        <label class="col-xs-4 control-label max-w-100"><span translate>订单类型</span>：</label>
                        <div class="col-xs-8 wrapper-none">
                            <select class="form-control" ng-model="condition.billTypeMode" >
                                <option value="" translate>请选择订单</option>
                                <option value="合同" translate>合同</option>
                                <option value="现金" translate>现金</option>
                                <option value="授信" translate>授信</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group clearfix" ng-if="isDL || isZHL" >
                        <label class="control-label"><span translate>订单是否预警</span>：</label>
                        <label class="control-label">
                            <input type="radio" class="m-r-sm pull-left" yb-radio
                                   ng-model="condition.notCompletedForOver7DaysCond" value="1"
                                   yb-radio-name="是">
                            <input type="radio" class="m-r-sm pull-left" yb-radio
                                   ng-model="condition.notCompletedForOver7DaysCond" value="0"
                                   yb-radio-name="否">
                        </label>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="sellTbConf" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{sellTbConf.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="th-check text-center border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allCheckedBill"
                                            yb-click="selectAll(dataList, 'Bill')"></div>
                                    </th>
                                    <th ng-repeat="itemCol in sellTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="sellTbConf.fixedWidth"
                                            fixed-width="tbStyle.sellFixedWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.sellFixedWidth">
                        <table class="table-fixed border-none" width="{{sellTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in sellTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(sellTbConf.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="sellTbConf.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeftWidth">
                        <table class="table-fixed border-none">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index" ng-click="selectRow($index)"
                                    ng-class="{'row-selected': $index === markInfo.curRow}">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, dataList, 'Bill')"></div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in sellTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <div class="font-0">
                                            <button class="btn btn-operate m-r-xs" ng-click="printBill(item)">打印</button>

                                            <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                ng-disabled="item.deliverStatus !== '0' || !btnPermission.sellIntentionEdit || (curUser.userId!==item.creatorId && item.createType!==2) || ((isJCH||isLDD||isNY||isNJ) && item.checkFlag==1)"
                                                title="{{!btnPermission.sellIntentionEdit?'无权限执行此操作':''}}">编辑
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="adjustBill(item)"
                                                ng-disabled="!btnPermission.sellIntentionAdjust||item.inventoryOutStatus=== '2'||item.inventoryOutStatus=== '3'"
                                                title="{{!btnPermission.sellIntentionAdjust?'无权限执行此操作':''}}">调整
                                            </button>
                                            <button class="btn btn-operate m-r-xs"
                                                ng-if="!isKJ"
                                                ng-click="delData(item.id)"
                                                ng-disabled="item.deliverStatus !== '0' || !btnPermission.sellIntentionDel "
                                                title="{{!btnPermission.sellIntentionDel?'无权限执行此操作':''}}">删除
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="synPrice(item.id)"
                                                ng-disabled="item.isSynPrice !== 1 || !btnPermission.sellIntentionSynPrice "
                                                title="{{!btnPermission.sellIntentionSynPrice?'无权限执行此操作':''}}">同步价格
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="syncSaleIntention4NS(item.id)"
                                                ng-disabled="!btnPermission.sellIntentionSyncSaleIntention4NS || item.syncNsStatus == 1"
                                                title="{{!btnPermission.sellIntentionSyncSaleIntention4NS?'无权限执行此操作':''}}">同步NS
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="importAttach(item)"
                                                ng-disabled="item.deliverStatus === '2' || !btnPermission.sellIntentionImport "
                                                title="{{!btnPermission.sellIntentionImport?'无权限执行此操作':''}}">上传附件
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="adjustBill(item,'price')"
                                                ng-disabled="!btnPermission.sellIntentionPriceAdjust"
                                                title="{{!btnPermission.sellIntentionPriceAdjust?'无权限执行此操作':''}}">调整价格
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="go2checkData(item, 4)"
                                                ng-if="(isJCH||isLDD||isNY||isNJ)"
                                                ng-disabled="!btnPermission.sellIntentionAudit || !(item.status==0 && !item.checkFlag)"
                                                title="{{!btnPermission.sellIntentionAudit?'无权限执行此操作':''}}">审核
                                            </button>
                                            <button class="btn btn-operate m-r-xs" ng-click="go2checkData(item, 6)"
                                                ng-if="isJCH"
                                                ng-disabled="!btnPermission.sellIntentionDegreeAudit||(item.degreeFlag==0||item.degreeStatus==2||item.checkFlag==1)"
                                                title="{{!btnPermission.sellIntentionDegreeAudit?'无权限执行此操作':''}}">超额度审核
                                            </button>
                                            <span ng-if="isKJ">
                                                <button class="btn btn-operate m-r-xs"
                                                    ng-click="applyDel(item.id)"
                                                    ng-disabled="!btnPermission.sellIntentionDelApply || item.deliverStatus !== '0' || item.canSubmitDeleteApplication==0"
                                                    title="{{!btnPermission.sellIntentionDelApply?'无权限执行此操作':''}}">删除申请
                                                </button>
                                                <button class="btn btn-operate m-r-xs"
                                                    ng-click="checkApplyDel(item.id)"
                                                    ng-disabled="!btnPermission.sellIntentionDelCheck || item.canAuditDeleteApplication==0"
                                                    title="{{!btnPermission.sellIntentionDelCheck?'无权限执行此操作':''}}">删除审核
                                                </button>
                                            </span>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.sellFixedWidth">
                        <table class="table-fixed border-none" width="{{sellTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index" ng-click="selectRow($index)"
                                    ng-class="{'row-selected': $index === markInfo.curRow}">
                                    <td class="spill-dots" ng-repeat="itemCol in sellTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span ng-if="!itemCol.clickFn">{{item[itemCol.dataField]}}</span>

                                        <span ng-if="!!itemCol.clickFn">
                                            <a ng-if="itemCol.type !== 'attach'" class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)">
                                                {{item[itemCol.dataField]}}
                                            </a>
                                            <a ng-if="itemCol.type === 'attach' && !!item[itemCol.dataField]" class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)">
                                                点击下载
                                            </a>
                                        </span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allCheckedBill" yb-check-name="全选"
                    yb-click="selectAll(dataList, 'Bill')"></div>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <!-- 手动制定、编辑 -->
        <div tab heading="{{tabFlag.name}}销售意向" active="activeFlag[1]" ng-if="activeFlag[1]">
            <form name="form" class="m-t-sm form-horizontal form-up-tb border-b clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>客户名称：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="purchaseOrgName" class="form-control light-bg"
                            ng-model="orderObj.headerInfo.purchaseOrgName" ng-click="selectDealer()" required yb-focus
                            readonly placeholder="请选择">
                        <div class="msg-block"
                            ng-if="form.purchaseOrgName.$dirty || (form.purchaseOrgName.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="form.purchaseOrgName.$error.required && !form.purchaseOrgName.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">工厂名称：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots"
                        title="{{orderObj.headerInfo.supplierOrgName}}">
                        {{orderObj.headerInfo.supplierOrgName|| '-'}}
                    </label>
                </div>
                <div ng-if="!!jckFlag" class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">是否赠送：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.isGift">
                            <option value=1>是</option>
                            <option value=0>否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">采购合同号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" class="form-control" ng-model="orderObj.headerInfo.purchaseContractNo">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span>供货商</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div yb-form-clear ng-model="orderObj.headerInfo.targetOrgName" select-obj="selectSupplier()"
                            clear-form="clearSupplier()" tips-name="供货商" form-require="true"></div>

                        <div class="msg-block" ng-if="!orderObj.headerInfo.targetOrgName && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                请选择供货商
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!!isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>采购员：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" class="form-control light-bg" required
                            ng-model="orderObj.headerInfo.buyerName" ng-click="selectBuyerName()"
                            readonly placeholder="请选择">
                        <div class="msg-block" ng-if="!orderObj.headerInfo.buyerName && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                请选择采购员
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span>销售渠道</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.salesChannel">
                            <option value="">请选择</option>
                            <option value=0>经销商</option>
                            <option value=1>海外子公司</option>
                            <option value=2>大项目</option>
                            <option value=3>终端客户</option>
                            <option value=4>其他</option>
                        </select>

                        <div class="msg-block" ng-if="!orderObj.headerInfo.salesChannel && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                请选择销售渠道
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i ng-if="isJCHK || isJCH">*</i><span>国家和地区</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div dealer-dictionary-selector ng-model="orderObj.headerInfo.country" option-changed="onCountryChange()" source="countries"
                            sel-key="country" org-id="{{ isJCHK?'jckClientId':'' }}" allow-search="true">
                            <input type="text" name="country" class="form-control light-bg" ng-model="orderObj.headerInfo.country"
                                placeholder="请选择" readonly yb-focus ng-required="isJCHK || isJCH">
                        </div>
                        <div class="msg-block" ng-show="form.country.$dirty || (form.country.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.country.$error.required && !form.country.focused">
                                <div class="msg-triangle"></div>
                                <span>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">申请日期：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.createDate | YbDate}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><span translate>交货日期</span>：</label>
                    <div class="col-xs-8 wrapper-none" ng-if="!(isDL||isZHL)">
                        <input type="text" name="deliveryDate" class="form-control date-picker cursor-pointer"
                            ng-model="orderObj.headerInfo.deliveryDate"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showDatepicker = !showDatepicker"
                            is-open="showDatepicker" modal-size="small" close-text="关闭" readonly>
                    </div>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" ng-if="isDL||isZHL">
                        {{ (orderObj.headerInfo.deliveryDate|YbDate:"yyyy-MM-dd") || '-' }}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH&&!isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>采购级别：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div select-purchase-type first-level-model="orderObj.headerInfo.purchaseLevelId"
                            second-level-model="orderObj.headerInfo.purchaseTypeChildId"
                            parent-type-name="orderObj.headerInfo.purchaseLevelName"
                            child-type-name="orderObj.headerInfo.purchaseTypeChildName"></div>
                        <div class="msg-block"
                            ng-if="form.purchaseType.$dirty || (form.purchaseType.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="form.purchaseType.$error.required && !form.purchaseType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                        <div class="msg-block" style="left: 100px;"
                            ng-if="form.secondPurchaseType.$dirty || (form.secondPurchaseType.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="form.secondPurchaseType.$error.required && !form.secondPurchaseType.focused">
                                <div class="msg-triangle"></div>
                                <span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>发运方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div select-send-type first-level-model="orderObj.headerInfo.deliverTypeId"
                            second-level-model="orderObj.headerInfo.sendTypeChildId"
                            parent-type-name="orderObj.headerInfo.deliverTypeName"
                            child-type-name="orderObj.headerInfo.sendTypeChildName"></div>
                        <div class="msg-block" ng-if="form.sendType.$dirty || (form.sendType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.sendType.$error.required && !form.sendType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH&&!isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>结算方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div dictionary-selector ng-model="orderObj.headerInfo.settleTypeName" sel-key="JSFS">
                            <input type="text" name="settleType" class="form-control light-bg"
                                ng-model="orderObj.headerInfo.settleTypeName" placeholder="请选择" required readonly
                                yb-focus>
                        </div>

                        <div class="msg-block"
                            ng-if="form.settleType.$dirty || (form.settleType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.settleType.$error.required && !form.settleType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>收货人：</label>
                    <div class="col-xs-5 wrapper-none">
                        <input type="text" name="receiverName" class="form-control"
                            ng-model="orderObj.headerInfo.receiverName" required yb-focus maxlength="11">

                        <div class="msg-block"
                            ng-show="form.receiverName.$dirty || (form.receiverName.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="form.receiverName.$error.required && !form.receiverName.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-3 p-l-sm p-r-none control-btn">
                        <button class="btn btn-default form-control" type="button"
                            ng-click="searchAddress(orderObj.headerInfo.receiverName,orderObj.headerInfo.purchaseOrgId)">搜索</button>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">联系方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiverPhone" class="form-control"
                            ng-model="orderObj.headerInfo.receiverPhone" yb-contact yb-focus>
                        <div class="msg-block"
                            ng-show="form.receiverPhone.$dirty || (form.receiverPhone.$invalid && submitted)">
                            <div class="error-msg"
                                ng-show="form.receiverPhone.$error.contactInfo && !form.receiverPhone.focused">
                                <div class="msg-triangle"></div>
                                联系方式格式错误
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">收货地址：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiveAddress" class="form-control"
                            ng-model="orderObj.headerInfo.receiveAddress" maxlength="200">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">传真：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiverFax" class="form-control"
                            ng-model="orderObj.headerInfo.receiverFax" maxlength="20" yb-tel>

                        <div class="msg-block"
                            ng-show="form.receiverFax.$dirty || (form.receiverFax.$invalid && submitted)">
                            <div class="error-msg" ng-show="form.receiverFax.$error.tel && !form.receiverFax.focused">
                                <div class="msg-triangle"></div>
                                传真格式错误
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">地区：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="region" class="form-control" ng-model="orderObj.headerInfo.region"
                            maxlength="20">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">合同：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="contract" class="form-control" ng-model="orderObj.headerInfo.contract"
                            maxlength="60">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">机型：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div bj-select  source="TJJXList" source-label-key="name" ng-if="isTJ"
                        ng-model="orderObj.headerInfo.model" bind-key="code"></div>
                        <input type="text" name="model" class="form-control" ng-model="orderObj.headerInfo.model" ng-if="!isTJ"
                            maxlength="60">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH&&!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">采购单号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="purchaseNo" class="form-control"
                            ng-model="orderObj.headerInfo.purchaseNo" maxlength="20">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">是否缺货统计：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.isStockoutStatistics">
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i ng-if="isJCHK">*</i>是否前移：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" name="forward" ng-model="orderObj.headerInfo.forward" ng-required="isJCHK">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                        <div class="msg-block" ng-show="form.forward.$dirty || (form.forward.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.forward.$error.required && !form.forward.focused">
                                <div class="msg-triangle"></div>
                                <span>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK && orderObj.headerInfo.forward==1">
                    <label class="col-xs-4 control-label max-w-100">前移协议号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" class="form-control" ng-model="orderObj.headerInfo.forwardProtocolNo" maxlength="50">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="remark" class="form-control" ng-model="orderObj.headerInfo.remark"
                            maxlength="200">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">订单总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots"
                        title="{{orderObj.headerInfo.totalSettlementPrice}}">
                        {{orderObj.headerInfo.totalSettlementPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">调整总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots"
                        title="{{orderObj.headerInfo.totalDiscountPrice}}">
                        {{orderObj.headerInfo.totalDiscountPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isTJ">
                    <label class="col-xs-4 control-label max-w-100">尾差金额：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="remark" class="form-control"
                            ng-model="orderObj.headerInfo.cashShortAndOver" yb-number-input disable-decimal="false"
                            decimal-places="2" max="9999999.99">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">币种：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots"
                        title="{{orderObj.headerInfo.currency}}">
                        {{orderObj.headerInfo.currency || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100">外销总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots"
                        title="{{orderObj.headerInfo.totalExportPrice}}">
                        {{orderObj.headerInfo.totalExportPrice || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>分销类型：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" name="distributionType" ng-disabled="orderObj.headerInfo.status == 1" ng-model="orderObj.headerInfo.distributionType" ng-required="isJCHK">
                            <option value="">请选择</option>
                            <option value="1">自营</option>
                            <option value="2">收购</option>
                        </select>
                        <div class="msg-block" ng-show="form.distributionType.$dirty || (form.distributionType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.distributionType.$error.required && !form.distributionType.focused">
                                <div class="msg-triangle"></div>
                                <span>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH"> 
                    <label class="col-xs-4 control-label max-w-100"><span translate>订单类型</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.billTypeMode" >
                            <option value="" translate>请选择订单</option>
                            <option value="合同" translate>合同</option>
                            <option value="现金" translate>现金</option>
                            <option value="授信" translate>授信</option>
                        </select>
                    </div>
                </div> 
            </form>
            <div class="row wrapper-y-xs">
                <div class="col-xs-12 operate-bar flex">
                    <button class="btn btn-operate m-r-sm" ng-click="selMateriel($event)">选择零件</button>
                    <button class="btn btn-operate m-r-sm" ng-click="importMateriel()">导入零件</button>
                    <button class="btn btn-operate m-r-sm" ng-click="batchDelMateriel()">批量删除</button>
                    <button ng-show="orderObj.materialList.length > 0" class="btn btn-operate m-r-sm" ng-click="batchChosePriceSchemeForManual()">批量选择价格方案</button>
                    <button ng-show="orderObj.materialList.length > 0" class="btn btn-operate m-r-sm " ng-if="isJCHK" ng-click="batchChosePriceSchemeWX()">批量选择外销价格方案</button>
                    <div ng-if="isDL||isZHL" class="fl m-l" style="display:flex;align-items:end;">
                        <label class="fl">批量设置交货日期：</label>
                        <label class="fl">
                            <input type="text" class="form-control date-picker" placeholder="请选择"
                                datepicker-popup="{{'yyyy-MM-dd'}}" modal-size="small"
                                is-open="fahuoDateShow" close-text="关闭" readonly
                                ng-model="fahuoDateModel"
                                ng-change="fahuoDateChange(fahuoDateModel)"
                                ng-click="fahuoDateShow=!fahuoDateShow">
                        </label>
                    </div>
                </div>
            </div>
            <div materiel-selector show-toolbar="toolbarConfig.showMateriel" selected-list="orderObj.materialList"
                is-purchase="true" dealer-id="dealerOrgIdCus" supplier-id="supplyOrgId" goal-type="sell">
            </div>
            <div class="main-area d-b-60" ng-style="{'top':isZHJCH?(!isJCHK?'380px': orderObj.headerInfo.forward == 1? '350px':'300px'):'300px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{editTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="th-check text-center">
                                        <div yb-check-box yb-checked="markInfo.allCheckedMaterial"
                                            yb-click="selectAll(orderObj.materialList, 'Material')"></div>
                                    </th>
                                    <th width="60">
                                        操作
                                    </th>
                                    <th width="60" class="text-center">
                                        <span>序号</span>
                                    </th>
                                    <th ng-repeat="itemCol in editTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                        <div yb-thead-operate ng-model="itemCol" target-width="editTbConf.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                        <table class="table-fixed border-none" width="{{editTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.materialList track by $index; rowIndex = $index">
                                    <td width="40" class="text-center">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, orderObj.materialList, 'Material')"></div>
                                    </td>
                                    <td width="60">
                                        <button type="button" class="btn btn-operate"
                                            ng-click="delMateriel(item, $index, $event)">删除</button>
                                    </td>
                                    <td width="60">
                                        {{$index+1}}
                                    </td>
                                    <td ng-repeat="itemCol in editTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!itemCol.hidden"
                                        ng-class="{'wrapper-none': itemCol.inputType === 'func','danger-color': itemCol.needWarn}">
                                        <div class="spill-dots" ng-if="!itemCol.input"
                                            title="{{item[itemCol.dataField]}}">
                                            <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                                ng-if="!!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </a>
                                            <a class="btn-operate m-r-xs"
                                                ng-click="tdClick(sapStockMap[item.materialsNo], itemCol.clickFnDaChang)"
                                                ng-if="!!itemCol.clickFnDaChang">
                                                {{sapStockMap[item.materialsNo].totalStock}}
                                            </a>
                                            <span ng-if="!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </span>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === ''" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <div bj-select  source="TJJXList" source-label-key="name" ng-if="isTJ"
                                                ng-model="item[itemCol.dataField]" bind-key="code"></div>
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]" maxlength="100" ng-if="!isTJ">
                                            <div class="pos-a tool-tips"
                                                ng-if="!!item.modelErr && !item[itemCol.dataField]">
                                                <i class="triangle"></i>
                                                <div class="msg">适用机型不能为空</div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'num'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                max="99999999.99" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyErr">
                                                <i class="triangle"></i>
                                                <div class="msg">申请数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]"
                                            select-obj="chosePriceScheme(item, $parent.$parent.$parent.$index)"
                                            clear-form="clearPriceScheme(item)" tips-name="价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'func'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]" 
                                            select-obj="chosePriceSchemeWX(item, $parent.$parent.$parent.$index)"
                                            clear-form="clearPriceSchemeWX(item, $parent.$parent.$parent.$index)" tips-name="外销价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'funcWX'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'waixiaoPrice'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control edit"
                                                ng-model="item[itemCol.dataField]"
                                                ng-change="setWaixiaoPrice(item, itemCol.dataField)" yb-number-input
                                                disable-decimal="false" decimal-places="2" max="99999999.99"
                                                ng-focus="showErrTip(item,'waixiaojia')" ng-blur="hideErrTip(item,'waixiaojia')"
                                                ng-class="{'error': item.priceWaixiaojiaErr||item.priceWaixiaojiaShowErr}">

                                            <div class="pos-a tool-tips" ng-if="!!item.priceWaixiaojiaShowErr">
                                                <div ng-if="!!item.priceWaixiaojiaErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">外销单价不能为空和0</div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'numAdjust'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                max="99999999.99" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyAdjustErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyAdjustErr">
                                                <i class="triangle"></i>
                                                <div class="msg">调整后数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'price'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control edit"
                                                ng-model="item[itemCol.dataField]"
                                                ng-change="setAdjustPrice(item, itemCol.dataField)" yb-number-input
                                                disable-decimal="false" decimal-places="2" max="99999999.99"
                                                ng-focus="showErrTip(item,'priceAdjust')" ng-blur="hideErrTip(item,'priceAdjust')"
                                                ng-class="{'error': item.priceAdjustErr||item.priceAdjustLowerErr||item.priceAdjustShowErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.priceAdjustShowErr">
                                                <div ng-if="!!item.priceAdjustErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">调整后单价不能为空和0</div>
                                                </div>
                                                <div ng-if="!!item.priceAdjustLowerErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">调整后单价不能低于{{item.unitPriceAfterAdjustOrig}}</div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'checkbox'"
                                            class="text-center">
                                            <div yb-check-box yb-checked="item['isChecked']"
                                                yb-click="checkItem(item, itemCol.dataField)"></div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'time'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control date-picker cursor-pointer"
                                                ng-model="item[itemCol.dataField]" datepicker-popup="{{'yyyy-MM-dd'}}"
                                                ng-change="jiaohuoDateChange()"
                                                ng-click="switchListDatePicker(item)" at-right="true"
                                                is-open="item.showDatePicker" close-text="关闭"
                                                ng-class="{'error': item.dateErr && !item[itemCol.dataField]}" readonly>
                                            <div class="pos-a tool-tips"
                                                ng-if="!!item.dateErr && !item[itemCol.dataField]">
                                                <i class="triangle"></i>
                                                <div class="msg">交货日期不能为空</div>
                                            </div>
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'note'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" name="remark" class="form-control"
                                                ng-model="item[itemCol.dataField]" maxlength="60">
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.materialList.length === 0">暂时没有数据
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-show="!isZHJCH&&(tabFlag.type != 1)"
                    ng-click="saveData(form.$valid,'settlement')">结算</button>

                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid, 'noPrice')"
                    ng-if="!(isJCH||isLDD||isNY||isNJ)">无价格提交</button>
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-if="!orderObj.headerInfo.status || orderObj.headerInfo.status === '0' || (isJCH||isLDD||isNY||isNJ)"
                    ng-click="saveData(form.$valid, 'save')">保存草稿</button>
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid, 'submit')"
                    ng-if="!(isJCH||isLDD||isNY||isNJ)">确认下发</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="cancel()">取消</button>
            </div>
        </div>

        <div tab heading="选择代理商采购申请" active="activeFlag[2]" ng-if="activeFlag[2] || ((activeFlag[3]||activeFlag[6]||activeFlag[7]) && actionType === 0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="searchPurchaseBill()"
                            title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="采购单号"
                            ng-model="billCondition.billNo">
                        <span class="input-group-addon cursor-pointer" ng-click="searchPurchaseBill(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="searchPurchaseBill(1)"
                reset-data="resetPurchaseCondition()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">采购单号：</label>
                        <input type="text" class="form-control" ng-model="billCondition.billNo">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" class="form-control" ng-model="billCondition.purchaseOrgName">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购级别：</label>
                        <select ng-model="billCondition.purchaseType" class="form-control"
                            ng-options="item.code as item.name for item in purchaseLevelList">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="purchaseTbConf" col-fixed="true"
                set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{purchaseTbConf.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in purchaseTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(purchaseTbConf.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="purchaseTbConf.fixedWidth"
                                            fixed-width="tbStyle.purchaseFixedWidth"></div>
                                    </th>
                                    <th width="120" class="border-r-none">
                                        操作
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.purchaseFixedWidth">
                        <table class="table-fixed border-none" width="{{purchaseTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in purchaseTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(purchaseTbConf.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="purchaseTbConf.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="purchaseList.length > 0">
                        <table class="table-fixed border-none" width="{{purchaseTbConf.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in purchaseList track by $index" ng-click="selectRow($index)"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}">
                                    <td class="border-l-none spill-dots"
                                        ng-repeat="itemCol in purchaseTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'"
                                        title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                    <td width="200" class="border-l-none font-0">
                                        <button class="btn btn-operate"
                                            ng-click="makeIntention(0, item, true)">制定销售意向</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="purchaseList.length > 0" ng-style="tbStyle.purchaseFixedWidth">
                        <table class="table-fixed border-none" width="{{purchaseTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in purchaseList track by $index" ng-click="selectRow($index)"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in purchaseTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="purchaseList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfoPurchase" yb-refresh="searchPurchaseBill()"></div>
            </div>
        </div>

        <!-- 自动制定、编辑 -->
        <div tab heading="{{tabFlag.name}}销售意向" active="activeFlag[3]" ng-if="activeFlag[3]||activeFlag[6]||activeFlag[7]">
            <form name="form" class="m-t-sm form-horizontal form-up-tb clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">销售意向单：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.saleNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">客户名称：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.purchaseOrgName || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">申请日期：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.createDate | YbDate}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">交货日期：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.deliveryDate | YbDate}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">采购单号：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.purchaseNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">采购合同号：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.purchaseContractNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">采购级别：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.purchaseLevelNameShow || "-"}}
                    </label>
                </div>
                <div ng-if="jckFlag" class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">是否赠送：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.isGift">
                            <option value=1>是</option>
                            <option value=0>否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>发运方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div select-send-type first-level-model="orderObj.headerInfo.deliverTypeId"
                            second-level-model="orderObj.headerInfo.sendTypeChildId"
                            parent-type-name="orderObj.headerInfo.deliverTypeName"
                            child-type-name="orderObj.headerInfo.sendTypeChildName"></div>
                        <div class="msg-block" ng-if="form.sendType.$dirty || (form.sendType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.sendType.$error.required && !form.sendType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>结算方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div dictionary-selector ng-model="orderObj.headerInfo.settleTypeName" sel-key="JSFS">
                            <input type="text" name="settleType" class="form-control light-bg"
                                ng-model="orderObj.headerInfo.settleTypeName" placeholder="请选择" required readonly
                                yb-focus>
                        </div>

                        <div class="msg-block"
                            ng-if="form.settleType.$dirty || (form.settleType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.settleType.$error.required && !form.settleType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">收货人：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiverName" class="form-control" ng-disabled="tabFlag.type==0"
                            ng-model="orderObj.headerInfo.receiverName" maxlength="20">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">联系方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" class="form-control" ng-disabled="tabFlag.type==0"
                            ng-model="orderObj.headerInfo.receiverPhone" maxlength="20">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">收货地址：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiveAddress" class="form-control" ng-disabled="tabFlag.type==0"
                            ng-model="orderObj.headerInfo.receiveAddress" maxlength="200">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">传真：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiverFax" class="form-control"
                            ng-model="orderObj.headerInfo.receiverFax" maxlength="20" yb-tel>

                        <div class="msg-block"
                            ng-show="form.receiverFax.$dirty || (form.receiverFax.$invalid && submitted)">
                            <div class="error-msg" ng-show="form.receiverFax.$error.tel && !form.receiverFax.focused">
                                <div class="msg-triangle"></div>
                                传真格式错误
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">地区：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="region" class="form-control" ng-model="orderObj.headerInfo.region"
                            maxlength="20">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">合同：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="contract" class="form-control" ng-model="orderObj.headerInfo.contract"
                            maxlength="60">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">机型：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div bj-select  source="TJJXList" source-label-key="name" ng-if="isTJ"
                        ng-model="orderObj.headerInfo.model" bind-key="code"></div>
                        <input type="text" name="model" class="form-control" ng-model="orderObj.headerInfo.model" ng-if="!isTJ"
                            maxlength="60">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">是否缺货统计：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" name="isStockoutStatistics"
                            ng-model="orderObj.headerInfo.isStockoutStatistics">
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i ng-if="isJCHK">*</i>是否前移：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" name="forward" ng-model="orderObj.headerInfo.forward" ng-required="isJCHK">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                        <div class="msg-block" ng-show="form.forward.$dirty || (form.forward.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.forward.$error.required && !form.forward.focused">
                                <div class="msg-triangle"></div>
                                <span>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK && orderObj.headerInfo.forward==1">
                    <label class="col-xs-4 control-label max-w-100">前移协议号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" class="form-control" ng-model="orderObj.headerInfo.forwardProtocolNo" maxlength="50">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="remark" class="form-control" ng-model="orderObj.headerInfo.remark"
                            maxlength="200">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">订单总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.headerInfo.totalSettlementPrice}}">
                        {{orderObj.headerInfo.totalSettlementPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">调整总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.headerInfo.totalDiscountPrice}}">
                        {{orderObj.headerInfo.totalDiscountPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isTJ">
                    <label class="col-xs-4 control-label max-w-100">尾差金额：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="cashShortAndOver" class="form-control"
                            ng-model="orderObj.headerInfo.cashShortAndOver" yb-number-input disable-decimal="false"
                            decimal-places="2" max="9999999.99">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">服务信息单号：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.headerInfo.crmServiceNo||'-'}}">
                        {{orderObj.headerInfo.crmServiceNo || '-'}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span>供货商</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div yb-form-clear ng-model="orderObj.headerInfo.targetOrgName" select-obj="selectSupplier4AddAuto()"
                            clear-form="clearSupplierAddAuto()" tips-name="供货商" form-require="true"></div>

                        <div class="msg-block" ng-if="!orderObj.headerInfo.targetOrgName && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                请选择供货商
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>采购员：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" class="form-control light-bg" required
                            ng-model="orderObj.headerInfo.buyerName" ng-click="selectBuyerName()"
                            readonly placeholder="请选择">
                        <div class="msg-block" ng-if="!orderObj.headerInfo.buyerName && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                请选择采购员<span></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span>销售渠道</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.salesChannel">
                            <option value="">请选择</option>
                            <option value=0>经销商</option>
                            <option value=1>海外子公司</option>
                            <option value=2>大项目</option>
                            <option value=3>终端客户</option>
                            <option value=4>其他</option>
                        </select>

                        <div class="msg-block" ng-if="!orderObj.headerInfo.salesChannel && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                请选择销售渠道
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span>国家和地区</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div dealer-dictionary-selector ng-model="orderObj.headerInfo.country" option-changed="onCountryChange()" source="countries"
                            sel-key="country" allow-search="true">
                            <input type="text" name="country" class="form-control light-bg" ng-model="orderObj.headerInfo.country"
                                placeholder="请选择" readonly yb-focus required>
                        </div>
                        <div class="msg-block" ng-show="form.country.$dirty || (form.country.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.country.$error.required && !form.country.focused">
                                <div class="msg-triangle"></div>
                                <span>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!isJCHK">
                    <label class="col-xs-4 control-label max-w-100">国家和地区：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.country || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">币种：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.currency || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100">外销总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots"
                        title="{{orderObj.headerInfo.totalExportPrice}}">
                        {{orderObj.headerInfo.totalExportPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm"ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>分销类型：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" name="distributionType" ng-disabled="orderObj.headerInfo.status == 1" ng-model="orderObj.headerInfo.distributionType" ng-required="isJCHK">
                            <option value="">请选择</option>
                            <option value="1">自营</option>
                            <option value="2">收购</option>
                        </select>
                        <div class="msg-block" ng-show="form.distributionType.$dirty || (form.distributionType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.distributionType.$error.required && !form.distributionType.focused">
                                <div class="msg-triangle"></div>
                                <span>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH">
                    <label class="col-xs-4 control-label max-w-100">订单类型：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.billTypeMode || "-"}}
                    </label>
                </div>
            </form>
            <div class="row wrapper-y-xs">
                <div class="col-xs-12 operate-bar flex">
                    <button class="btn btn-operate m-r-sm" ng-click="importWaixiaoPrice()" ng-if="isJCHK">导入外销单价</button>
                    <button ng-show="orderObj.materialList.length > 0" class="btn btn-operate m-r-sm fl" ng-click="batchChosePriceScheme()">批量选择价格方案</button>
                    <button ng-show="orderObj.materialList.length > 0" class="btn btn-operate m-r-sm fl" ng-if="isJCHK" ng-click="batchChosePriceSchemeWX()">批量选择外销价格方案</button>
                    <button ng-show="showTransferFlag" class="btn btn-operate m-r-sm fl" ng-click="batchSetTransferFlag()">是否接受调拨</button>
                    <div ng-if="isDL||isZHL" class="fl m-l" style="display:flex;align-items:end;">
                        <label class="fl">批量设置交货日期：</label>
                        <label class="fl">
                            <input type="text" class="form-control date-picker" placeholder="请选择"
                                datepicker-popup="{{'yyyy-MM-dd'}}" modal-size="small"
                                is-open="fahuoDateShow" close-text="关闭" readonly
                                ng-model="fahuoDateModel"
                                ng-change="fahuoDateChange(fahuoDateModel)"
                                ng-click="fahuoDateShow=!fahuoDateShow">
                        </label>
                    </div>
                </div>
            </div>
            <div class="main-area d-b-60" ng-style="{top:isJCHK||jckFlag?'420px': isJCH?'380px' : '350px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{autoEditTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="60">
                                        操作
                                    </th>
                                    <th width="60" class="text-center">
                                        <span>序号</span>
                                    </th>
                                    <th ng-repeat="itemCol in autoEditTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                        <div yb-thead-operate ng-model="itemCol" target-width="autoEditTbConf.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                        <table class="table-fixed border-none" width="{{autoEditTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.materialList track by $index; rowIndex = $index">
                                    <td width="60">
                                        <button type="button" class="btn btn-operate"
                                            ng-click="delMateriel(item, $index, $event)">删除</button>
                                    </td>
                                    <td width="60">
                                        {{$index+1}}
                                    </td>
                                    <td ng-repeat="itemCol in autoEditTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!itemCol.hidden"
                                        ng-class="{'wrapper-none': itemCol.inputType === 'func'}">
                                        <div class="spill-dots" ng-if="!itemCol.input"
                                            title="{{item[itemCol.dataField]}}">
                                            <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                                ng-if="!!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </a>
                                            <a class="btn-operate m-r-xs"
                                                ng-click="tdClick(sapStockMap[item.materialsNo], itemCol.clickFnDaChang)"
                                                ng-if="!!itemCol.clickFnDaChang">
                                                {{sapStockMap[item.materialsNo].totalStock}}
                                            </a>
                                            <span ng-if="!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </span>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'num'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                max="99999999.99" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyErr">
                                                <i class="triangle"></i>
                                                <div class="msg">申请数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]"
                                            select-obj="chosePriceScheme(item, $parent.$parent.$parent.$index)"
                                            clear-form="clearPriceScheme(item, $parent.$parent.$parent.$index)" tips-name="价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'func'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]" 
                                            select-obj="chosePriceSchemeWX(item, $parent.$parent.$parent.$index)"
                                            clear-form="clearPriceSchemeWX(item, $parent.$parent.$parent.$index)" tips-name="外销价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'funcWX'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'waixiaoPrice'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control edit"
                                                ng-model="item[itemCol.dataField]"
                                                ng-change="setWaixiaoPrice(item, itemCol.dataField)" yb-number-input
                                                disable-decimal="false" decimal-places="2" max="99999999.99"
                                                ng-focus="showErrTip(item,'waixiaojia')" ng-blur="hideErrTip(item,'waixiaojia')"
                                                ng-class="{'error': item.priceWaixiaojiaErr||item.priceWaixiaojiaShowErr}">

                                            <div class="pos-a tool-tips" ng-if="!!item.priceWaixiaojiaShowErr">
                                                <div ng-if="!!item.priceWaixiaojiaErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">外销单价不能为空和0</div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'numAdjust'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                max="99999999.99" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyAdjustErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyAdjustErr">
                                                <i class="triangle"></i>
                                                <div class="msg">调整后数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'price'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <!-- update by spd 下面这行增加矿机不可以修改单价的判断 -->
                                            <input type="text" class="form-control edit" ng-readonly="isWJ || isKJ"
                                                ng-model="item[itemCol.dataField]"
                                                ng-change="setAdjustPrice(item, itemCol.dataField)" yb-number-input
                                                disable-decimal="false" decimal-places="2" max="99999999.99"
                                                ng-focus="showErrTip(item,'priceAdjust')" ng-blur="hideErrTip(item,'priceAdjust')"
                                                ng-class="{'error': item.priceAdjustErr||item.priceAdjustLowerErr||item.priceAdjustShowErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.priceAdjustShowErr">
                                                <div ng-if="!!item.priceAdjustErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">调整后单价不能为空和0</div>
                                                </div>
                                                <div ng-if="!!item.priceAdjustLowerErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">调整后单价不能低于{{item.unitPriceAfterAdjustOrig}}</div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'time'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control date-picker cursor-pointer"
                                                ng-model="item[itemCol.dataField]" datepicker-popup="{{'yyyy-MM-dd'}}"
                                                ng-change="jiaohuoDateChange()"
                                                ng-click="switchListDatePicker(item)" at-right="true"
                                                is-open="item.showDatePicker" close-text="关闭"
                                                ng-class="{'error': item.dateErr && !item[itemCol.dataField]}" readonly>
                                            <div class="pos-a tool-tips"
                                                ng-if="!!item.dateErr && !item[itemCol.dataField]">
                                                <i class="triangle"></i>
                                                <div class="msg">交货日期不能为空</div>
                                            </div>
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'note'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" name="remark" class="form-control"
                                                ng-model="item[itemCol.dataField]" maxlength="60">
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'checkbox'"
                                            class="text-center">
                                            <div yb-check-box yb-checked="item['isChecked']"
                                                yb-click="checkItem(item, itemCol.dataField)"></div>
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'select'"
                                             class="td-edit pos-r">
                                            <select ng-model="item[itemCol.dataField]"
                                                    ng-options="item.code as item.name for item in transferList">
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.materialList.length === 0">暂时没有数据
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-if="!isZHJCH&&tabFlag.name!='编辑'"
                    ng-click="saveData(form.$valid,'settlement')">结算</button>

                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid, 'noPrice')"
                    ng-if="!(isJCH||isLDD||isNY||isNJ)">无价格提交</button>
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-if="!orderObj.headerInfo.status || orderObj.headerInfo.status === '0' || (isJCH||isLDD||isNY||isNJ)"
                    ng-click="saveData(form.$valid, 'save')">保存草稿</button>
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid, 'submit')"
                    ng-if="!(isJCH||isLDD||isNY||isNJ)">确认下发</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="cancel()">取消</button>
            </div>
        </div>

        <!-- 查看、审核 -->
        <div tab heading="{{tabFlag.name}}" active="activeFlag[4]" ng-if="activeFlag[4]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm" ng-repeat="item in detailMap track by $index" ng-if="item.isShow">
                    <label class="col-xs-4 m-b-n text-right max-w-100" ng-if="item.name != '是否前移'">{{item.name}}：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" ng-if="item.name != '是否前移'"
                        title="{{orderObj.headerInfo[item.field] || '-'}}">
                        {{orderObj.headerInfo[item.field] || '-'}}
                    </div>
                    <label class="col-xs-4 m-b-n text-right max-w-100" ng-if="item.name == '是否前移'">{{item.name}}：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" ng-if="item.name == '是否前移'"
                        title="{{orderObj.headerInfo[item.field] | TrueOrFalse}}">
                        {{orderObj.headerInfo[item.field] | TrueOrFalse}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH" >
                    <label class="col-xs-4 m-b-n text-right max-w-100" >订单类型：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" ng-if="isJCH"
                         title="{{orderObj.headerInfo.billTypeMode ||'-'}}">
                        {{orderObj.headerInfo.billTypeMode ||'-' }}
                    </div>
                </div>
            </div>
            <div tabset type="sub-tab">
                <div tab heading="零件信息" active="subTabFlag[0]">
                    <div class="row wrapper-y-xs" ng-if="isJCH||isNJ||isNY">
                        <div class="col-xs-12 operate-bar font-0">
                            <button class="btn btn-operate m-r-sm" ng-click="batchPrint4Details()">批量打印</button>
                        </div>
                    </div>
                    <div class="main-area d-b-60" ng-style="{'top':isJCH||isNJ?'310px':(isTJ?'295px':'305px')}">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="{{viewTbConf.scrollWidth}}">
                                    <thead>
                                        <tr>
                                            <th width="40" class="text-center th-check border-l-none">
                                                <div yb-check-box yb-checked="markInfo.allCheckedMaterialDetail" yb-click="selectAll(orderObj.materialList, 'MaterialDetail')"></div>
                                            </th>
                                            <th width="60" class="border-l-none" ng-if="isJCH||isNJ||isNY">操作</th>
                                            <th width="60" class="text-center">
                                                <span>序号</span>
                                            </th>
                                            <th ng-repeat="itemCol in viewTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                                <div yb-thead-operate ng-model="itemCol"
                                                    target-width="viewTbConf.scrollWidth"></div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                                <table class="table-fixed border-none" width="{{viewTbConf.scrollWidth}}">
                                    <tbody>
                                        <tr ng-repeat="item in orderObj.materialList track by $index">
                                            <td width="40" class="text-center border-l-none">
                                                <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, orderObj.materialList, 'MaterialDetail')"></div>
                                            </td>
                                            <td width="60" class="font-0" ng-if="isJCH||isNJ||isNY">
                                                <button class="btn btn-operate m-r-xs" ng-click="printBill4Details(item)">打印</button>
                                            </td>
                                            <td width="60">
                                                {{$index+1}}
                                            </td>
                                            <td class="spill-dots"
                                                ng-repeat="itemCol in viewTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                                ng-if="!itemCol.hidden">
                                                <span ng-if="!!itemCol.clickFnDaChang">
                                                    {{sapStockMap[item.materialsNo].totalStock}}
                                                </span>
                                                <span ng-else>
                                                    {{item[itemCol.dataField]}}
                                                </span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="no-data w-full text-center p-t" ng-show="dataList.materialList.length === 0">
                                暂时没有数据
                            </div>
                        </div>
                    </div>
                </div>
                <div tab heading="发货通知" active="subTabFlag[1]" ng-click="getDeliveryNotice()">
                    <div class="main-area d-b-60" ng-style="{'top':isTJ?'270px':'280px'}">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="{{deliveryTbConf.scrollWidth}}">
                                    <thead>
                                        <tr>
                                            <th ng-repeat="itemCol in deliveryTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}">
                                                <div yb-thead-operate ng-model="itemCol"></div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll" ng-show="deliveryList.length > 0">
                                <table class="table-fixed border-none" width="{{deliveryTbConf.scrollWidth}}">
                                    <tbody>
                                        <tr ng-repeat="item in deliveryList track by $index">
                                            <td class="spill-dots"
                                                ng-repeat="itemCol in deliveryTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}">
                                                {{item[itemCol.dataField]}}
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="no-data w-full text-center p-t" ng-show="deliveryList.length === 0">暂时没有数据</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <span ng-if="(isJCH||isLDD||isNY||isNJ)">
                    <span ng-if="isCheckFlag==4">
                        <button type="button" class="btn btn-primary m-r-sm"
                            ng-click="checkData(orderObj.headerInfo.id, 1)">通过</button>
                        <button type="button" class="btn btn-danger m-r-sm"
                            ng-click="checkData(orderObj.headerInfo.id, 0)">拒绝</button>
                    </span>
                    <span ng-if="isCheckFlag==6">
                        <button type="button" class="btn btn-primary m-r-sm"
                            ng-click="degreeCheckData(orderObj.headerInfo.id, 2)">通过</button>
                        <button type="button" class="btn btn-danger m-r-sm"
                            ng-click="degreeCheckData(orderObj.headerInfo.id, 1)">拒绝</button>
                    </span>
                    <span ng-if="!isCheckFlag">
                        <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(true, 'submit')"
                            ng-disabled="orderObj.headerInfo.checkFlag!=1||orderObj.headerInfo.status==1">确认下发</button>
                    </span>
                </span>
                <span ng-if="!(isJCH||isLDD||isNY||isNJ) && !isMonitoringViewFlag">
                    <button type="button" class="btn btn-default m-r-sm" ng-click="changeTab(0)">返回</button>
                </span>
                <span ng-if="!(isJCH||isLDD||isNY||isNJ) && isMonitoringViewFlag">
                    <button type="button" class="btn btn-default m-r-sm" ng-click="changeTab(11)">返回</button>
                </span>
            </div>
        </div>

        <div tab heading="调整" active="activeFlag[5]" ng-if="activeFlag[5]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm" ng-repeat="item in detailMap track by $index" ng-if="item.isShow">
                    <label class="col-xs-4 control-label max-w-100 text-right">{{item.name}}：</label>
                    <label ng-if="!item.inputType" class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo[item.field] !== null ? orderObj.headerInfo[item.field] : '-'}}
                    </label>
                    <div class="col-xs-8 wrapper-none"
                        ng-if="item.inputType && item.inputType == 'input' && item.field != 'cashShortAndOver'">
                        <input type="text" name="remark" class="form-control" ng-model="orderObj.headerInfo[item.field]"
                            maxlength="200">
                    </div>
                    <div class="col-xs-8 wrapper-none"
                        ng-if="item.inputType && item.inputType == 'input' && item.field == 'cashShortAndOver'">
                        <input type="text" name="cashShortAndOver" class="form-control"
                            ng-model="orderObj.headerInfo[item.field]" yb-number-input disable-decimal="false"
                            decimal-places="2" max="9999999.99">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm"  ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100 text-right">外销总价:</label>
                    <label ng-if="!item.inputType" class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo.totalExportPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH">
                    <label class="col-xs-4 control-label max-w-100 text-right"><span translate>订单类型</span>：</label>
                    <label  class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo.billTypeMode|| '-'}}
                    </label>
                </div>
            </div>
            <div tabset type="sub-tab">
                <div tab heading="零件信息" active="subTabFlag[0]">
                    <div class="row wrapper-y-xs">
                        <div class="col-xs-12 operate-bar flex">
                            <button class="btn btn-operate m-r-sm" ng-click="selMateriel($event)">选择零件</button>
                            <button class="btn btn-operate m-r-sm" ng-click="importReplaceMateriel()" ng-if="!isJCHK"><span>导入替换零件</span></button>
                            <button class="btn btn-operate m-r-sm" ng-click="importWaixiaoPrice()" ng-if="isJCHK">导入外销单价</button>
                            
                            <div ng-if="isDL||isZHL" class="fl m-l" style="display:flex;align-items:end;">
                                <label class="fl">批量设置交货日期：</label>
                                <label class="fl">
                                    <input type="text" class="form-control date-picker" placeholder="请选择"
                                        datepicker-popup="{{'yyyy-MM-dd'}}" modal-size="small"
                                        is-open="fahuoDateShow" close-text="关闭" readonly
                                        ng-model="fahuoDateModel"
                                        ng-change="fahuoDateChange(fahuoDateModel)"
                                        ng-click="fahuoDateShow=!fahuoDateShow">
                                </label>
                            </div>
                        </div>
                    </div>
                    <div materiel-selector show-toolbar="toolbarConfig.showMateriel"
                        selected-list="orderObj.materialList" is-purchase="true"
                        dealer-id="orderObj.headerInfo.purchaseOrgId" goal-type="sell" supplier-id="orderObj.headerInfo.isPlatCompany?supplyOrgId:curOrgId"></div>
                    <div class="main-area d-b-60" ng-style="{'top': isJCHK?'470px':'430px'}">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="{{adjustTbConf.scrollWidth}}">
                                    <thead>
                                        <tr>
                                            <th width="120">
                                                操作
                                            </th>
                                            <th width="60" class="text-center">
                                                <span>序号</span>
                                            </th>
                                            <th ng-repeat="itemCol in adjustTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                                <div yb-thead-operate ng-model="itemCol"
                                                    target-width="adjustTbConf.scrollWidth"></div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                                <table class="table-fixed border-none" width="{{adjustTbConf.scrollWidth}}">
                                    <tbody>
                                        <tr ng-repeat="item in orderObj.materialList track by $index">
                                            <td width="120">
                                                <button type="button" class="btn btn-operate"
                                                    ng-disabled="item.informedAmount > 0"
                                                    ng-click="adjustDelMateriel($index, $event)">删除</button>
                                                    <!-- add by spd  || item.isFrozen === 1  -->
                                                    <button type="button" class="btn btn-operate"
                                                    ng-disabled="item.amountAfterAdjust === item.informedAmount || item.isFrozen === 1"
                                                    ng-click="frozenMateriel($index, $event)">冻结</button>
                                                    <button type="button" class="btn btn-operate"
                                                    ng-disabled="item.isFrozen === 0"
                                                    ng-click="unFrozenMateriel($index, $event)">解冻</button>
                                                    <!-- end -->
                                            </td>
                                            <td width="60">
                                                {{$index+1}}
                                            </td>
                                            <td ng-repeat="itemCol in adjustTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                                ng-if="!itemCol.hidden">
                                                <div class="spill-dots" ng-if="!itemCol.input"
                                                    title="{{item[itemCol.dataField]}}">
                                                    {{item[itemCol.dataField]}}
                                                </div>
                                                <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]"
                                                    select-obj="chosePriceScheme(item, $parent.$parent.$parent.$index)"
                                                    clear-form="clearPriceScheme(item)" tips-name="价格方案"
                                                    ng-if="!!itemCol.input && itemCol.inputType === 'func'"
                                                    title="{{item[itemCol.dataField]}}">
                                                </div>
                                                <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]" 
                                                select-obj="chosePriceSchemeWX(item, $parent.$parent.$parent.$index)"
                                                clear-form="clearPriceSchemeWX(item, $parent.$parent.$parent.$index)" tips-name="外销价格方案"
                                                ng-if="!!itemCol.input && itemCol.inputType === 'funcWX'"
                                                title="{{item[itemCol.dataField]}}"></div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'waixiaoPrice'"
                                                    class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                                    <input type="text" class="form-control edit"
                                                        ng-model="item[itemCol.dataField]"
                                                        ng-change="setWaixiaoPrice(item, itemCol.dataField)" yb-number-input
                                                        disable-decimal="false" decimal-places="2" max="99999999.99"
                                                        ng-focus="showErrTip(item,'waixiaojia')" ng-blur="hideErrTip(item,'waixiaojia')"
                                                        ng-class="{'error': item.priceWaixiaojiaErr||item.priceWaixiaojiaShowErr}">

                                                    <div class="pos-a tool-tips" ng-if="!!item.priceWaixiaojiaShowErr">
                                                        <div ng-if="!!item.priceWaixiaojiaErr">
                                                            <i class="triangle"></i>
                                                            <div class="msg">外销单价不能为空和0</div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'num'"
                                                    class="td-edit pos-r" title="{{item[itemCol.dataField]}}">

                                                    <input type="text" class="form-control"
                                                        ng-model="item[itemCol.dataField]"
                                                        ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                        max="99999999.99" disable-decimal="false" decimal-places="3"
                                                        ng-class="{'error': item.qtyAdjustErr}"
                                                        >
                                                    <div class="pos-a tool-tips" ng-if="!!item.qtyAdjustErr">
                                                        <i class="triangle"></i>
                                                        <div class="msg">调整后数量不能为空和0</div>
                                                    </div>
                                                </div>
                                                <div ng-if="!!orderObj.headerInfo.adjustMachineModel && itemCol.inputType === 'machineModel'" class="td-edit pos-r">
                                                    <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                           maxlength="100">
                                                    <div class="pos-a tool-tips"
                                                        ng-if="!!item.modelErr && !item[itemCol.dataField]">
                                                        <i class="triangle"></i>
                                                        <div class="msg">适用机型不能为空</div>
                                                    </div>
                                                </div>
                                                <div ng-if="!orderObj.headerInfo.adjustMachineModel && itemCol.inputType === 'machineModel'" class="spill-dots">
                                                    {{item[itemCol.dataField]}}
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'unitPriceAfterAdjust'"
                                                    class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                                    <input type="text" class="form-control"
                                                        ng-model="item[itemCol.dataField]"
                                                        ng-change="setAdjustPrice(item, itemCol.dataField)" yb-number-input
                                                        disable-decimal="false" decimal-places="2" max="99999999.99"
                                                        ng-focus="showErrTip(item,'priceAdjust')" ng-blur="hideErrTip(item,'priceAdjust')"
                                                        ng-class="{'error': item.priceAdjustLowerErr||item.priceAdjustShowErr}">
                                                    <div class="pos-a tool-tips" ng-if="!!item.priceAdjustShowErr">
                                                        <div ng-if="!!item.priceAdjustLowerErr">
                                                            <i class="triangle"></i>
                                                            <div class="msg">调整后单价不能低于{{item.unitPriceAfterAdjustOrig}}</div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'checkbox'"
                                                    class="text-center">
                                                    <div yb-check-box yb-checked="item['isChecked']"
                                                        yb-click="checkItem(item, itemCol.dataField)"></div>
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'time'" class="td-edit pos-r"
                                                    title="{{item[itemCol.dataField]}}">
                                                    <input type="text" class="form-control date-picker cursor-pointer"
                                                        ng-model="item[itemCol.dataField]" datepicker-popup="{{'yyyy-MM-dd'}}"
                                                        ng-change="jiaohuoDateChange()"
                                                        ng-click="switchListDatePicker(item)" at-right="true"
                                                        is-open="item.showDatePicker" close-text="关闭"
                                                        ng-class="{'error': item.dateErr && !item[itemCol.dataField]}" readonly>
                                                    <div class="pos-a tool-tips"
                                                        ng-if="!!item.dateErr && !item[itemCol.dataField]">
                                                        <i class="triangle"></i>
                                                        <div class="msg">交货日期不能为空</div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="no-data w-full text-center p-t" ng-show="dataList.materialList.length === 0">
                                暂时没有数据
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-default m-r-sm" ng-click="adjustData(0)">调整</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="changeTab(0)">取消</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="frozenAllData(1)">全部冻结</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="frozenAllData(0)">全部解冻</button>
            </div>
        </div>

        <div tab heading="新增收款单" active="activeFlag[6]" ng-if="activeFlag[6]||activeFlag[7]">
            <div class="pos-a-full shuttle-box left" style="right: 65%;top: 35px;">
                <div class="box-head clearfix">
                    <span class="font-14">
                        收款信息
                    </span>
                </div>
                <div class="pos-a-full box-body has-head has-foot border-t">
                    <form name="checkForm" class="main-wrap form-horizontal form-up-tb p-t clearfix" novalidate>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">往来对象：</label>
                            <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                                {{orderObj.headerInfo.purchaseOrgName}}
                            </label>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">结算方式：</label>
                            <label class="col-xs-8 control-label p-l-n text-left clearfix">
                                按订单结算
                            </label>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">收款金额：</label>
                            <label class="col-xs-8 control-label p-l-n text-left clearfix">
                                {{orderObj.headerInfo.amountCollected}} 元
                            </label>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">优惠金额：</label>
                            <div class="col-xs-8 wrapper-none">
                                <input type="text" name="discountPrice" class="form-control"
                                    ng-change="changePreferentialAmount()" ng-model="orderObj.headerInfo.discountPrice"
                                    yb-number-input max="orderObj.headerInfo.amountCollected" disable-decimal="false"
                                    decimal-places="2">
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">实际收款金额：</label>
                            <label class="col-xs-8 control-label p-l-n text-left clearfix">
                                {{((orderObj.headerInfo.realPrice==0||orderObj.headerInfo.realPrice)?orderObj.headerInfo.realPrice:orderObj.headerInfo.amountCollected)|decimalPlaces:'2'}}
                                元
                            </label>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label"><i>*</i>经办人：</label>
                            <div class="col-xs-8 wrapper-none">
                                <input type="text" name="operatorName" class="form-control light-bg"
                                    ng-model="orderObj.headerInfo.operatorName" ng-click="selectOperator()" required
                                    yb-focus readonly placeholder="请选择">

                                <div class="msg-block"
                                    ng-show="checkForm.operatorName.$dirty || (checkForm.operatorName.$invalid && submitted)">
                                    <div class="error-msg"
                                        ng-if="checkForm.operatorName.$error.required && !checkForm.operatorName.focused">
                                        <div class="msg-triangle"></div>
                                        必填项，请填写
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">收款时间：</label>
                            <label class="col-xs-8 control-label p-l-n text-left spill-dots">
                                {{orderObj.headerInfo.createDate | YbDate:"yyyy-MM-dd HH:mm:ss"}}
                            </label>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">备注：</label>
                            <div class="col-xs-8 wrapper-none">
                                <input type="text" name="note" class="form-control" ng-model="orderObj.headerInfo.note"
                                    maxlength="200">
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label"><i>*</i>发出仓库：</label>
                            <div class="col-xs-8 wrapper-none">
                                <div yb-form-clear ng-model="orderObj.headerInfo.outLocation"
                                    select-obj="selectWarehouse()" clear-form="clearWarehouse()" tips-name="发出仓库"
                                    form-require="true"></div>

                                <div class="msg-block" ng-if="!orderObj.headerInfo.outLocation && submitted">
                                    <div class="error-msg">
                                        <div class="msg-triangle"></div>
                                        请选择发出仓库
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label"><i>*</i>发出库区：</label>
                            <div class="col-xs-8 wrapper-none">
                                <div yb-form-clear ng-model="orderObj.headerInfo.outArea" select-obj="selectArea()"
                                    clear-form="clearArea()" tips-name="发出库区" form-require="true"></div>

                                <div class="msg-block" ng-if="!orderObj.headerInfo.outArea && submitted">
                                    <div class="error-msg">
                                        <div class="msg-triangle"></div>
                                        请选择发出库区
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">币种：</label>
                            <label class="col-xs-8 control-label p-l-n text-left clearfix">
                                {{orderObj.headerInfo.currency || '-'}} 元
                            </label>
                        </div>
                    </form>
                </div>
                <div class="bottom-area btn-bar text-center border-t clearfix">
                    <button type="button" class="btn btn-primary m-r-sm" ng-click="saveAddReceipt(checkForm.$valid)">保存
                    </button>
                    <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
                </div>
            </div>
            <div class="pos-a-full shuttle-box right" style="left: 35%;top: 35px;bottom: 10px">
                <div class="box-head clearfix">
                    <span class="font-14">
                        收款单据
                    </span>
                </div>
                <div class="pos-a-full box-body has-head border-t">
                    <div yb-table-fixed class="table-fixed-wrap" style="top: 15px;left: 0">
                        <div class="th-scroll-x">
                            <table class="table-fixed border-none" width="{{receiptTableInfo.tableConfig.scrollWidth}}">
                                <thead>
                                    <tr>
                                        <th ng-repeat="itemCol in receiptTableInfo.tableConfig.tableCol track by $index"
                                            width="{{itemCol.width}}"
                                            ng-click="receiptTableInfo.toSort(receiptTableInfo.tableConfig.tableCol, $index)"
                                            ng-show="!!itemCol.isShow">
                                            <div yb-thead-operate ng-model="itemCol"
                                                target-width="receiptTableInfo.tableConfig.scrollWidth"></div>
                                        </th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                        <div class="td-scroll" ng-show="receiptTableInfo.dataList.length > 0">
                            <table class="table-fixed border-none" width="{{receiptTableInfo.tableConfig.scrollWidth}}">
                                <tbody>
                                    <tr ng-repeat="item in receiptTableInfo.dataList track by $index"
                                        ng-class="{'row-selected': $index === receiptTableInfo.markInfo.curRow}"
                                        ng-click="receiptTableInfo.selectRow($index)">
                                        <td class="spill-dots"
                                            ng-repeat="itemCol in receiptTableInfo.tableConfig.tableCol track by $index"
                                            width="{{itemCol.width}}" ng-show="!!itemCol.isShow"
                                            title="{{item[itemCol.dataField]}}">
                                            <div ng-switch="itemCol.type">
                                                <div ng-switch-when="click">
                                                    <a class="btn-operate m-r-xs"
                                                        ng-click="receiptTableInfo.tdClick(item, itemCol.clickFn)">
                                                        {{item[itemCol.dataField]}}
                                                    </a>
                                                </div>
                                                <div ng-switch-default>
                                                    <span>{{item[itemCol.dataField]}}</span>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="no-data w-full text-center p-t" ng-show="receiptTableInfo.dataList.length === 0">
                            暂时没有数据
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div tab heading="单据详情" active="activeFlag[7]" ng-if="activeFlag[7]">
            <div class="main-area d-b-60" style="top:35px;">
                <div class="m-t-sm form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100 spill-dots" title="发货通知单号">发货通知单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.deliveryNo || '-'}}">
                            {{orderDetailObj.deliveryNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">客户名称：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.purchaseOrgName || '-'}}">
                            {{orderDetailObj.purchaseOrgName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">销售意向单：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.saleNo || '-'}}">
                            {{orderDetailObj.saleNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">采购单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.purchaseNo || '-'}}">
                            {{orderDetailObj.purchaseNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">sap关联单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.sapOutNo || '-'}}">
                            {{orderDetailObj.sapOutNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">SAP销售订单：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.sapSaleOrder || '-'}}">
                            {{orderDetailObj.sapSaleOrder || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">SAP外向发货单：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.sapOutBill || '-'}}">
                            {{orderDetailObj.sapOutBill || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">零件凭证：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.materialsNo || '-'}}">
                            {{orderDetailObj.materialsNo || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">采购级别：</label>
                        <div class="col-xs-8 wrapper-none spill-dots"
                            title="{{orderDetailObj.purchaseLevelName || '-'}}">
                            {{orderDetailObj.purchaseLevelName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">售达方：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.sold || '-'}}">
                            {{orderDetailObj.sold || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">送达方：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.delivery || '-'}}">
                            {{orderDetailObj.delivery || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100 spill-dots" title="采购订单编号">采购订单编号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots"
                            title="{{orderDetailObj.customerPurchaseCode || '-'}}">
                            {{orderDetailObj.customerPurchaseCode || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">分销渠道：</label>
                        <div class="col-xs-8 wrapper-none spill-dots"
                            title="{{orderDetailObj.distributionChannelName || '-'}}">
                            {{orderDetailObj.distributionChannelName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">付款条件：</label>
                        <div class="col-xs-8 wrapper-none spill-dots"
                            title="{{orderDetailObj.payConditionName || '-'}}">
                            {{orderDetailObj.payConditionName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">订单类型：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.orderType || '-'}}">
                            {{orderDetailObj.orderType || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发运方式：</label>
                        <div class="col-xs-8 wrapper-none spill-dots"
                            title="{{orderDetailObj.deliveryTypeName || '-'}}">
                            {{orderDetailObj.deliveryTypeName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">结算方式：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.settleTypeName || '-'}}">
                            {{orderDetailObj.settleTypeName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发出仓库：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.outLocation || '-'}}">
                            {{orderDetailObj.outLocation || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发出库区：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.outArea || '-'}}">
                            {{orderDetailObj.outArea || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">收货人：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.receiverName || '-'}}">
                            {{orderDetailObj.receiverName || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">联系方式：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.receiverPhone || '-'}}">
                            {{orderDetailObj.receiverPhone || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">传真：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.receiverFax || '-'}}">
                            {{orderDetailObj.receiverFax || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">收货地址：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.address || '-'}}">
                            {{orderDetailObj.address || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">备注：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.note || '-'}}">
                            {{orderDetailObj.note || "-"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">制单时间：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.address|YbDate}}">
                            {{orderDetailObj.createDate|YbDate:"yyyy-MM-dd HH:mm:ss"}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">是否打印：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.isPrint===0?'否':'是'}}">
                            {{orderDetailObj.isPrint===0?'否':'是'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">总价：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.totalDiscountPrice}}">
                            {{orderDetailObj.totalDiscountPrice}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">币种：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{orderDetailObj.currency || '-'}}">
                            {{orderDetailObj.currency || '-'}}
                        </div>
                    </div>
                </div>
                <div yb-table-fixed class="table-fixed-wrap" style="top:210px">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{orderDetailTableInfo.tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in orderDetailTableInfo.tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="orderDetailTableInfo.tableConfig.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderDetailTableInfo.dataList.length > 0">
                        <table class="table-fixed border-none" width="{{orderDetailTableInfo.tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderDetailTableInfo.dataList track by $index">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in orderDetailTableInfo.tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span>{{item[itemCol.dataField]}}</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderDetailTableInfo.dataList.length === 0">
                        暂时没有数据
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-default" ng-click="changeTab(6)">返回</button>
            </div>
        </div>

        <div tab heading="选择合同协议" active="activeFlag[8]" ng-if="activeFlag[8]||(activeFlag[9] && actionType === 3)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="searchContractBill()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列" ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="合同号" ng-model="contractCondition.billNo">
                        <span class="input-group-addon cursor-pointer" ng-click="searchContractBill(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="searchContractBill(1)" reset-data="resetContractCondition()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">合同号：</label>
                        <input type="text" class="form-control" ng-model="contractCondition.billNo">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" class="form-control" ng-model="contractCondition.purchaseOrgName">
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="contractTbConf" col-fixed="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{contractTbConf.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in contractTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="contractTbConf.fixedWidth"
                                            fixed-width="tbStyle.contractFixedWidth"></div>
                                    </th>
                                    <th width="120" class="border-r-none">
                                        操作
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.contractFixedWidth">
                        <table class="table-fixed border-none" width="{{contractTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in contractTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="contractTbConf.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="contractList.length > 0">
                        <table class="table-fixed border-none" width="{{contractTbConf.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in contractList track by $index">
                                    <td class="border-l-none spill-dots"
                                        ng-repeat="itemCol in contractTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'"
                                        title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                    <td width="200" class="border-l-none font-0">
                                        <button class="btn btn-operate" ng-click="makeIntention(3, item)">制定销售意向</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="contractList.length > 0" ng-style="tbStyle.contractFixedWidth">
                        <table class="table-fixed border-none" width="{{contractTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in contractList track by $index">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in contractTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="contractList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfoContract" yb-refresh="searchContractBill()"></div>
            </div>
        </div>

        <!-- 按合同创建、编辑 -->
        <div tab heading="{{tabFlag.name}}销售意向" active="activeFlag[9]" ng-if="activeFlag[9]">
            <form name="form" class="m-t-sm form-horizontal form-up-tb clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">销售意向单：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.saleNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">客户名称：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.purchaseOrgName || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">申请日期：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.createDate | YbDate}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">交货日期：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="deliveryDate" class="form-control date-picker cursor-pointer"
                            ng-model="orderObj.headerInfo.deliveryDate"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showDatepicker = !showDatepicker"
                            is-open="showDatepicker" modal-size="small" close-text="关闭" readonly>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">合同号：</label>
                    <label class="col-xs-8 control-label p-l-n text-left">
                        {{orderObj.headerInfo.contractNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><span>国家和地区</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div dealer-dictionary-selector ng-model="orderObj.headerInfo.country" option-changed="onCountryChange()" source="countries"
                            sel-key="country" org-id="{{jckClientId}}" allow-search="true">
                            <input type="text" name="country" class="form-control light-bg" ng-model="orderObj.headerInfo.country"
                                placeholder="请选择" readonly yb-focus>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>发运方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div select-send-type first-level-model="orderObj.headerInfo.deliverTypeId"
                            second-level-model="orderObj.headerInfo.sendTypeChildId"
                            parent-type-name="orderObj.headerInfo.deliverTypeName"
                            child-type-name="orderObj.headerInfo.sendTypeChildName"></div>
                        <div class="msg-block" ng-if="form.sendType.$dirty || (form.sendType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.sendType.$error.required && !form.sendType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isZHJCH">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>结算方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div dictionary-selector ng-model="orderObj.headerInfo.settleTypeName" sel-key="JSFS">
                            <input type="text" name="settleType" class="form-control light-bg"
                                ng-model="orderObj.headerInfo.settleTypeName" placeholder="请选择" required readonly
                                yb-focus>
                        </div>

                        <div class="msg-block"
                            ng-if="form.settleType.$dirty || (form.settleType.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.settleType.$error.required && !form.settleType.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>收货人：</label>
                    <div class="col-xs-5 wrapper-none">
                        <input type="text" name="receiverName" class="form-control"
                            ng-model="orderObj.headerInfo.receiverName" required yb-focus maxlength="11">

                        <div class="msg-block"
                            ng-show="form.receiverName.$dirty || (form.receiverName.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="form.receiverName.$error.required && !form.receiverName.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-3 p-l-sm p-r-none control-btn">
                        <button class="btn btn-default form-control" type="button"
                            ng-click="searchAddress(orderObj.headerInfo.receiverName,orderObj.headerInfo.purchaseOrgId)">搜索</button>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">联系方式：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiverPhone" class="form-control"
                            ng-model="orderObj.headerInfo.receiverPhone" yb-contact yb-focus>
                        <div class="msg-block"
                            ng-show="form.receiverPhone.$dirty || (form.receiverPhone.$invalid && submitted)">
                            <div class="error-msg"
                                ng-show="form.receiverPhone.$error.contactInfo && !form.receiverPhone.focused">
                                <div class="msg-triangle"></div>
                                联系方式格式错误
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">收货地址：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiveAddress" class="form-control"
                            ng-model="orderObj.headerInfo.receiveAddress" maxlength="200">
                    </div>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">传真：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="receiverFax" class="form-control"
                            ng-model="orderObj.headerInfo.receiverFax" maxlength="20" yb-tel>

                        <div class="msg-block"
                            ng-show="form.receiverFax.$dirty || (form.receiverFax.$invalid && submitted)">
                            <div class="error-msg" ng-show="form.receiverFax.$error.tel && !form.receiverFax.focused">
                                <div class="msg-triangle"></div>
                                传真格式错误
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">地区：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="region" class="form-control" ng-model="orderObj.headerInfo.region"
                            maxlength="20">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">合同：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="contract" class="form-control" ng-model="orderObj.headerInfo.contract"
                            maxlength="60">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">机型：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="model" class="form-control" ng-model="orderObj.headerInfo.model"
                            maxlength="60">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">是否缺货统计：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" name="isStockoutStatistics"
                            ng-model="orderObj.headerInfo.isStockoutStatistics">
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">是否前移：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="orderObj.headerInfo.forward">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="remark" class="form-control" ng-model="orderObj.headerInfo.remark"
                            maxlength="200">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">订单总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.headerInfo.totalSettlementPrice}}">
                        {{orderObj.headerInfo.totalSettlementPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">调整总价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.headerInfo.totalDiscountPrice}}">
                        {{orderObj.headerInfo.totalDiscountPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH">
                    <label class="col-xs-4 control-label max-w-100">订单类型：</label>
                    <div class="col-xs-8 wrapper-none" ng-if="orderObj.headerInfo.createType==1">
                        <select class="form-control" ng-model="orderObj.headerInfo.billTypeMode"  >
                            <option value="" translate>请选择订单</option>
                            <option value="合同" translate>合同</option>
                            <option value="现金" translate>现金</option>
                            <option value="授信" translate>授信</option>
                        </select>
                    </div>
                    <label ng-if="orderObj.headerInfo.createType!=1" class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo.billTypeMode|| '-'}}
                    </label>
                </div>
            </form>
            <div class="row wrapper-y-xs">
                <div class="col-xs-12 operate-bar flex">
                    <button ng-show="orderObj.materialList.length > 0" class="btn btn-operate m-r-sm fl" ng-click="batchChosePriceScheme()">批量选择价格方案</button>
                </div>
            </div>
            <div class="main-area d-b-60" ng-style="{top:'300px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{autoEditTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="60">
                                        操作
                                    </th>
                                    <th width="60" class="text-center">
                                        <span>序号</span>
                                    </th>
                                    <th ng-repeat="itemCol in autoEditTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                        <div yb-thead-operate ng-model="itemCol" target-width="autoEditTbConf.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                        <table class="table-fixed border-none" width="{{autoEditTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.materialList track by $index; rowIndex = $index">
                                    <td width="60">
                                        <button type="button" class="btn btn-operate"
                                            ng-click="delMateriel(item, $index, $event)">删除</button>
                                    </td>
                                    <td width="60">
                                        {{$index+1}}
                                    </td>
                                    <td ng-repeat="itemCol in autoEditTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-if="!itemCol.hidden"
                                        ng-class="{'wrapper-none': itemCol.inputType === 'func'}">
                                        <div class="spill-dots" ng-if="!itemCol.input"
                                            title="{{item[itemCol.dataField]}}">
                                            <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                                ng-if="!!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </a>
                                            <a class="btn-operate m-r-xs"
                                                ng-click="tdClick(sapStockMap[item.materialsNo], itemCol.clickFnDaChang)"
                                                ng-if="!!itemCol.clickFnDaChang">
                                                {{sapStockMap[item.materialsNo].totalStock}}
                                            </a>
                                            <span ng-if="!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </span>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'num'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                max="99999999.99" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyErr">
                                                <i class="triangle"></i>
                                                <div class="msg">申请数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]"
                                            select-obj="chosePriceScheme(item, $parent.$parent.$parent.$index)"
                                            clear-form="clearPriceScheme(item, $parent.$parent.$parent.$index)" tips-name="价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'func'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]" 
                                            select-obj="chosePriceSchemeWX(item, $parent.$parent.$parent.$index)"
                                            clear-form="clearPriceSchemeWX(item, $parent.$parent.$parent.$index)" tips-name="外销价格方案"
                                            ng-if="!!itemCol.input && itemCol.inputType === 'funcWX'"
                                            title="{{item[itemCol.dataField]}}"></div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'waixiaoPrice'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control edit"
                                                ng-model="item[itemCol.dataField]"
                                                ng-change="setWaixiaoPrice(item, itemCol.dataField)" yb-number-input
                                                disable-decimal="false" decimal-places="2" max="99999999.99"
                                                ng-focus="showErrTip(item,'waixiaojia')" ng-blur="hideErrTip(item,'waixiaojia')"
                                                ng-class="{'error': item.priceWaixiaojiaErr||item.priceWaixiaojiaShowErr}">

                                            <div class="pos-a tool-tips" ng-if="!!item.priceWaixiaojiaShowErr">
                                                <div ng-if="!!item.priceWaixiaojiaErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">外销单价不能为空和0</div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'numAdjust'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                max="99999999.99" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyAdjustErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyAdjustErr">
                                                <i class="triangle"></i>
                                                <div class="msg">调整后数量不能为空和0</div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'price'"
                                            class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control edit"
                                                ng-model="item[itemCol.dataField]"
                                                ng-change="setAdjustPrice(item, itemCol.dataField)" yb-number-input
                                                disable-decimal="false" decimal-places="2" max="99999999.99"
                                                ng-focus="showErrTip(item,'priceAdjust')" ng-blur="hideErrTip(item,'priceAdjust')"
                                                ng-class="{'error': item.priceAdjustErr||item.priceAdjustLowerErr||item.priceAdjustShowErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.priceAdjustShowErr">
                                                <div ng-if="!!item.priceAdjustErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">调整后单价不能为空和0</div>
                                                </div>
                                                <div ng-if="!!item.priceAdjustLowerErr">
                                                    <i class="triangle"></i>
                                                    <div class="msg">调整后单价不能低于{{item.unitPriceAfterAdjustOrig}}</div>
                                                </div>
                                            </div>
                                        </div>

                                        <div ng-if="itemCol.input && itemCol.inputType === 'time'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" class="form-control date-picker cursor-pointer"
                                                ng-model="item[itemCol.dataField]" datepicker-popup="{{'yyyy-MM-dd'}}"
                                                ng-click="switchListDatePicker(item)" at-right="true"
                                                is-open="item.showDatePicker" close-text="关闭"
                                                ng-class="{'error': item.dateErr && !item[itemCol.dataField]}" readonly>
                                            <div class="pos-a tool-tips"
                                                ng-if="!!item.dateErr && !item[itemCol.dataField]">
                                                <i class="triangle"></i>
                                                <div class="msg">交货日期不能为空</div>
                                            </div>
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'note'" class="td-edit pos-r"
                                            title="{{item[itemCol.dataField]}}">
                                            <input type="text" name="remark" class="form-control"
                                                ng-model="item[itemCol.dataField]" maxlength="60">
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'checkbox'"
                                            class="text-center">
                                            <div yb-check-box yb-checked="item['isChecked']"
                                                yb-click="checkItem(item, itemCol.dataField)"></div>
                                        </div>
                                        <div ng-if="itemCol.input && itemCol.inputType === 'select'"
                                             class="td-edit pos-r">
                                            <select ng-model="item[itemCol.dataField]"
                                                    ng-options="item.code as item.name for item in transferList">
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="orderObj.materialList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-if="!isZHJCH&&tabFlag.name!='编辑'"
                    ng-click="saveData(form.$valid,'settlement')">结算</button>

                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid, 'noPrice')"
                    ng-if="!(isJCH||isLDD||isNY||isNJ)">无价格提交</button>
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-if="!orderObj.headerInfo.status || orderObj.headerInfo.status === '0' || (isJCH||isLDD||isNY||isNJ)"
                    ng-click="saveData(form.$valid, 'save')">保存草稿</button>
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid, 'submit')"
                    ng-if="!(isJCH||isLDD||isNY||isNJ)">确认下发</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="cancel()">取消</button>
            </div>
        </div>


        <div tab heading="调整价格" active="activeFlag[10]" ng-if="activeFlag[10]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm" ng-repeat="item in detailPriceMap track by $index" ng-if="item.isShow">
                    <label class="col-xs-4 control-label max-w-100 text-right">{{item.name}}：</label>
                    <label ng-if="!item.inputType" class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo[item.field] !== null ? orderObj.headerInfo[item.field] : '-'}}
                    </label>
                    <div class="col-xs-8 wrapper-none"
                        ng-if="item.inputType && item.inputType == 'input' && item.field != 'cashShortAndOver'">
                        <input type="text" name="remark" class="form-control" ng-model="orderObj.headerInfo[item.field]"
                            maxlength="200">
                    </div>
                    <div class="col-xs-8 wrapper-none"
                        ng-if="item.inputType && item.inputType == 'input' && item.field == 'cashShortAndOver'">
                        <input type="text" name="cashShortAndOver" class="form-control"
                            ng-model="orderObj.headerInfo[item.field]" yb-number-input disable-decimal="false"
                            decimal-places="2" max="9999999.99">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm"  ng-if="isJCHK">
                    <label class="col-xs-4 control-label max-w-100 text-right">外销总价:</label>
                    <label ng-if="!item.inputType" class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo.totalExportPrice}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="isJCH">
                    <label class="col-xs-4 control-label max-w-100 text-right"><span translate>订单类型</span>：</label>
                    <label  class="col-xs-8 control-label p-l-n text-left spill-dots">
                        {{orderObj.headerInfo.billTypeMode|| '-'}}
                    </label>
                </div>
            </div>
            <div tabset type="sub-tab">
                <div tab heading="零件信息" active="subTabFlag[0]">
                    <div class="row wrapper-y-xs">
                    </div>
                    <div materiel-selector show-toolbar="toolbarConfig.showMateriel"
                        selected-list="orderObj.materialList" is-purchase="true"
                        dealer-id="orderObj.headerInfo.purchaseOrgId" goal-type="sell" supplier-id="orderObj.headerInfo.isPlatCompany?supplyOrgId:curOrgId"></div>
                    <div class="main-area d-b-60" ng-style="{'top': isJCHK?'470px':'430px'}">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="{{adjustTbConf.scrollWidth}}">
                                    <thead>
                                        <tr>
                                            <th width="60" class="text-center">
                                                <span>序号</span>
                                            </th>
                                            <th ng-repeat="itemCol in adjustTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" ng-if="!itemCol.hidden">
                                                <div yb-thead-operate ng-model="itemCol"
                                                    target-width="adjustTbConf.scrollWidth"></div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll" ng-show="orderObj.materialList.length > 0">
                                <table class="table-fixed border-none" width="{{adjustTbConf.scrollWidth}}">
                                    <tbody>
                                        <tr ng-repeat="item in orderObj.materialList track by $index">
                                            <td width="60">
                                                {{$index+1}}
                                            </td>
                                            <td ng-repeat="itemCol in adjustTbConf.tableCol track by $index"
                                                width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}"
                                                ng-if="!itemCol.hidden">
                                                <div class="spill-dots" ng-if="!itemCol.input"
                                                    title="{{item[itemCol.dataField]}}">
                                                    {{item[itemCol.dataField]}}
                                                </div>
                                                <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]"
                                                    select-obj="chosePriceScheme(item, $parent.$parent.$parent.$index)"
                                                    clear-form="clearPriceScheme(item)" tips-name="价格方案"
                                                    ng-if="!!itemCol.input && itemCol.inputType === 'func'"
                                                    title="{{item[itemCol.dataField]}}">
                                                </div>
                                                <div yb-form-clear class="td-edit" ng-model="item[itemCol.dataField]" 
                                                select-obj="chosePriceSchemeWX(item, $parent.$parent.$parent.$index)"
                                                clear-form="clearPriceSchemeWX(item, $parent.$parent.$parent.$index)" tips-name="外销价格方案"
                                                ng-if="!!itemCol.input && itemCol.inputType === 'funcWX'"
                                                title="{{item[itemCol.dataField]}}"></div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'waixiaoPrice'"
                                                    class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                                    <input type="text" class="form-control edit"
                                                        ng-model="item[itemCol.dataField]"
                                                        ng-change="setWaixiaoPrice(item, itemCol.dataField)" yb-number-input
                                                        disable-decimal="false" decimal-places="2" max="99999999.99"
                                                        ng-focus="showErrTip(item,'waixiaojia')" ng-blur="hideErrTip(item,'waixiaojia')"
                                                        ng-class="{'error': item.priceWaixiaojiaErr||item.priceWaixiaojiaShowErr}">

                                                    <div class="pos-a tool-tips" ng-if="!!item.priceWaixiaojiaShowErr">
                                                        <div ng-if="!!item.priceWaixiaojiaErr">
                                                            <i class="triangle"></i>
                                                            <div class="msg">外销单价不能为空和0</div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'num'"
                                                    class="td-edit pos-r" title="{{item[itemCol.dataField]}}">

                                                    <input type="text" class="form-control"
                                                        ng-model="item[itemCol.dataField]"
                                                        ng-change="setPrice(item, itemCol.dataField)" yb-number-input
                                                        max="99999999.99" disable-decimal="false" decimal-places="3"
                                                        ng-class="{'error': item.qtyAdjustErr}" disabled
                                                        >
                                                    <div class="pos-a tool-tips" ng-if="!!item.qtyAdjustErr">
                                                        <i class="triangle"></i>
                                                        <div class="msg">调整后数量不能为空和0</div>
                                                    </div>
                                                </div>
                                                <div ng-if="!!orderObj.headerInfo.adjustMachineModel && itemCol.inputType === 'machineModel'" class="td-edit pos-r">
                                                    <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                           maxlength="100">
                                                    <div class="pos-a tool-tips"
                                                        ng-if="!!item.modelErr && !item[itemCol.dataField]">
                                                        <i class="triangle"></i>
                                                        <div class="msg">适用机型不能为空</div>
                                                    </div>
                                                </div>
                                                <div ng-if="!orderObj.headerInfo.adjustMachineModel && itemCol.inputType === 'machineModel'" class="spill-dots">
                                                    {{item[itemCol.dataField]}}
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'unitPriceAfterAdjust'"
                                                    class="td-edit pos-r" title="{{item[itemCol.dataField]}}">
                                                    <input type="text" class="form-control"
                                                        ng-model="item[itemCol.dataField]"
                                                        ng-change="setAdjustPrice(item, itemCol.dataField)" yb-number-input
                                                        disable-decimal="false" decimal-places="2" max="99999999.99"
                                                        ng-focus="showErrTip(item,'priceAdjust')" ng-blur="hideErrTip(item,'priceAdjust')"
                                                        ng-class="{'error': item.priceAdjustLowerErr||item.priceAdjustShowErr}">
                                                    <div class="pos-a tool-tips" ng-if="!!item.priceAdjustShowErr">
                                                        <div ng-if="!!item.priceAdjustLowerErr">
                                                            <i class="triangle"></i>
                                                            <div class="msg">调整后单价不能低于{{item.unitPriceAfterAdjustOrig}}</div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div ng-if="itemCol.input && itemCol.inputType === 'checkbox'"
                                                    class="text-center">
                                                    <div yb-check-box yb-checked="item['isChecked']" yb-disabled="true"
                                                        yb-click="checkItem(item, itemCol.dataField)"></div>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="no-data w-full text-center p-t" ng-show="dataList.materialList.length === 0">
                                暂时没有数据
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-default m-r-sm" ng-click="adjustData(0,'price')">调整</button>
                <button type="button" class="btn btn-default m-r-sm" ng-click="changeTab(0)">取消</button>
            </div>
        </div>

        <!-- 订单监控Tab页 -->
        <div tab heading="订单监控" active="activeFlag[11]" ng-if="activeFlag[11]">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="searchMonitoringBill()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列" ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color">
                            <i class="yb-icon ico-export-o"></i>
                            <ul class="more-tool">
                                <li yb-download download-url="monitoringExportParam.sectionUrl"
                                    download-param="monitoringExportParam.sectionParam" download-key="ids">
                                    <i class="yb-icon ico-export-o"></i> 导出
                                </li>
                                <li yb-download download-url="monitoringExportParam.allUrl" download-param="monitoringCondition" download-duration="3" is-ajax="true">
                                    <i class="yb-icon ico-export-o"></i><span translate>导出全部</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="意向单号" ng-model="monitoringCondition.billNos">
                        <span class="input-group-addon cursor-pointer" ng-click="searchMonitoringBill(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="searchMonitoringBill(1)" reset-data="resetMonitoringCondition()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">意向单号：</label>
                        <textarea ng-model="monitoringCondition.billNos" class="form-control" placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" class="form-control" ng-model="monitoringCondition.purchaseOrgName">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">采购级别：</label>
                        <select ng-model="monitoringCondition.purchaseLevelName" class="form-control"
                            ng-options="item.code as item.name for item in purchaseLevelList">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">创建人：</label>
                        <input type="text" ng-model="monitoringCondition.createName" class="form-control">
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="monitoringTbConf" col-fixed="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{monitoringTbConf.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="th-check text-center border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allCheckedMonitoring"
                                            yb-click="selectAll(monitoringList, 'Monitoring')"></div>
                                    </th>
                                    <th ng-repeat="itemCol in monitoringTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="monitoringTbConf.fixedWidth"
                                            fixed-width="tbStyle.monitoringFixedWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.monitoringFixedWidth">
                        <table class="table-fixed border-none" width="{{monitoringTbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in monitoringTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="monitoringTbConf.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="monitoringList.length > 0">
                        <table class="table-fixed border-none" width="{{monitoringTbConf.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in monitoringList track by $index">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, monitoringList, 'Monitoring')"></div>
                                    </td>
                                    <td class="border-l-none spill-dots"
                                        ng-repeat="itemCol in monitoringTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'"
                                        title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="monitoringList.length > 0" ng-style="tbStyle.monitoringFixedWidth">
                        <table class="table-fixed border-none" width="{{monitoringTbConf.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in monitoringList track by $index">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in monitoringTbConf.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span ng-if="!itemCol.clickFn">{{item[itemCol.dataField]}}</span>
                                        <span ng-if="!!itemCol.clickFn">
                                            <a ng-if="itemCol.type !== 'attach'" class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)">
                                                {{item[itemCol.dataField]}}
                                            </a>
                                        </span>
                                    </td>
                                </tr>
                                <tr class="yellow-bg">
                                    <td class="spill-dots font-bold" ng-repeat="itemCol in monitoringTbConf.tableCol track by $index">
                                        <div ng-switch="itemCol.dataField">
                                            <div ng-switch-when="saleNo" translate translate-attr-title="总计">总计</div>
                                            <div ng-switch-when="purchaseOrgName" translate translate-attr-title="111">共 {{tmonitoringTotalData.totalCount || ''}} 条</div>
                                            <div ng-switch-when="totalDiscountPrice" translate translate-attr-title="111">{{tmonitoringTotalData.totalDiscountPrice || '' }}</div>
                                            <div ng-switch-when="undistributedAmount" translate translate-attr-title="222">{{tmonitoringTotalData.undistributedAmount || '' }}</div>
                                            <div ng-switch-when="unshippedAmount" translate translate-attr-title="3">{{tmonitoringTotalData.unshippedAmount || '' }}</div>
                                            <div ng-switch-when="pendingInvoiceAmount" translate translate-attr-title="4">{{tmonitoringTotalData.pendingInvoiceAmount || '' }}</div>
                                            <div ng-switch-when="unablePostAmount" translate translate-attr-title="5">{{tmonitoringTotalData.unablePostAmount || '' }}</div>
                                            <div ng-switch-when="purchaseLevelName" translate translate-attr-title="5">--</div>
                                            <div ng-switch-when="createName" translate translate-attr-title="5">--</div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="monitoringList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfoMonitoring" yb-refresh="searchMonitoringBill()"></div>
            </div>
        </div>
    </div>
</div>
